<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Selezione Istanze modifica</title>
	<link rel="stylesheet" type="text/css" href="../styles/style.css" />
</h:head>
<h:body>
<div id="container">
<div id="box">

<header class="banner">
<span id="titoloPagina"> Seleziona l'istanza da modificare </span>
</header>

<div id="externalborder1">
<p:spacer height="40px" />


<h:form id="form"> 
      
      <p:growl id="growl" showDetail="true" sticky="true" />
	<h:panelGroup  rendered="#{param.noIst}">
	<div id="infoAgg" style="text-align: center;"><h:outputText value="Non hai selezionato alcuna istanza!"/><br/>
	</div>
	</h:panelGroup>
	<p:spacer height="40px" />
	

	<div id="externalborderTab"> 
		<p:dataTable id="istanzeSel" var="istanzaDTO" rowKey="#{istanzaDTO.idIstanza}" value="#{creaIstanze.listaIstanze}" rows="7" paginator="true" 
                 selection="#{creaIstanze.istanzaTmp}" selectionMode="single" sortMode="multiple" widgetVar="istTabel" style="text-align:center;" >  
  
  			
   		
			<p:ajax event="rowSelect" update=":form:growl" listener="#{creaIstanze.onRowSelectIstanza}"/>

   		
			<p:column id="idIstanza" sortBy="idIstanza"   
                headerText="ID Istanza"  
                >  
            <h:outputText value="#{istanzaDTO.idIstanza}" />  
        	</p:column>
        	
	        <p:column sortBy="dataInizio" headerText="Data di inizio">  
	            <h:outputText value="#{istanzaDTO.dataInizio}">  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />      
            </h:outputText>    
	        </p:column>  
	   
  
	        <p:column sortBy="dataFine" headerText="Data di fine">  
	            <h:outputText value="#{istanzaDTO.dataFine}" >  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />      
            </h:outputText>    
	        </p:column>  
	  
	      
	        <p:column headerText="Disponiblità">  
	            <h:outputText value="#{istanzaDTO.disponibilita}" />  
	        </p:column>  
	           
	        <p:column headerText="Prezzo">  
	            <h:outputText value="#{istanzaDTO.prezzo}" />  
	        </p:column>
	        
	
	        
	    
	        
	    </p:dataTable>
    </div>
    
 </h:form> 
 
      	     <p:spacer height="40px"/>
<h:form>

<div id="centerbutton">

<h:commandLink id="visualizzalink" action="#{creaIstanze.checkNull()}">
<div class="button" id="visualizza">
Modifica Istanza
</div>
</h:commandLink>


<!-- il vecchio era un commandbutton -->
				
				</div>


</h:form>


   
 </div>
</div>
<div id="push">
</div>
</div>

<div id="footer">
<h:button id="homepage" value="Homepage" outcome="index.xhtml"></h:button>
</div>

</h:body>  

    
</html>